home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
serien
/
purity
/
nr.18
/
uniprint
/
uniprintv1.3.p
< prev
Wrap
Text File
|
1995-04-22
|
52KB
|
1,688 lines
program UniPrint;
{------------------------------------------------------------------------}
{ *** UniPrint V1.3 ***
© in 8/1993 by Jan Stötzer; This tool is FREEWARE as long nothing is
changed and the files »UniPrint«,»UniPrint.dok« and »UniPrint.prf«
are copied and distributed together.
Have fun.......
For Bug-Reports, hints, ideas, legal swapping ... write to:
Jan Stötzer
An der Hasel 195
98527 Suhl }
{------------------------------------------------------------------------}
Uses Intuition,Graphics;
{$incl "libraries/dosextens.h"}
type xytyp = array[1..12] of integer;
ImgPlane = array[1..8] of word;
PrefsTyp = record
Version : string[5];
Colors : array[0..3,0..2] of cardinal;
Qual : cardinal;
NewForm : cardinal;
Request : cardinal;
end;
var Scr : ^Screen;
Vp : ViewPort;
Win : ^Window;
OWin: ^Window;
WWin: ^Window;
WCon: ptr;
Rast: ^RastPort;
Prc : ^Process;
PrcH: Ptr;
Txt : array[0..22] of IntuiText; Static;
Bor : array[1..22] of Border; Static;
xy : array[1..20] of xytyp;
Img : array[1..2] of Image; Static;
Dat : array[1..2] of ^ImgPlane; Static;
Inf : array[1..15] of StringInfo; Static;
Gad : array[0..24] of Gadget; Static;
Msg : ^IntuiMessage;
UpPr: PrefsTyp;
f : file of PrefsTyp;
PDat: PrefsTyp;
Buf : array[1..15] of string[60]; Static;
UBuf: array[1..15] of string[60]; Static;
MCl : long;
MCod: word;
MAdr: ^Gadget;
i : integer;
ex : boolean;
cnt : integer;
cnt2: integer;
x : char;
ok : boolean;
FirstCall : boolean; {Help-Var 4 Printer-Rout}
NotFirstCall : boolean; {Help-Var 4 Prefs-Rout}
{------------------------------------------------------------------------}
procedure CreateBoolXYData(b,h:integer;var xy1,xy2:xytyp);
begin
xy1:=xytyp(-2,-2,-2,h+2,b+2,h+2,b+1,h+1,-1,h+1,-1,-1);
xy2:=xytyp(-1,-2,b+2,-2,b+2,h+1,b+1,h,b+1,-1,0,-1);
end;
{------------------------------------------------------------------------}
procedure CreateStringXYData(b,h:integer;var xy1,xy2:xyTyp);
begin
xy1:=xyTyp(-4,-4,-4,h+2,b+4,h+2,b+3,h+1,-3,h+1,-3,-3);
xy2:=xyTyp(-3,-4,b+4,-4,b+4,h+1,b+3,h,b+3,-3,-2,-3);
end;
{------------------------------------------------------------------------}
function Sure:boolean;
var SWin : ^Window;
SRast: ^RastPort;
SMsg : ^IntuiMessage;
STxt : array[1..3] of IntuiText;
Sxy : array[1..4] of xyTyp;
SBor : array[1..4] of Border;
SGad : array[1..2] of Gadget;
AGad : ^Gadget;
ex : boolean;
begin
SWin:=Open_Window(15,199,615,46,1,GADGETUP+RAWKEY,BORDERLESS+ACTIVATE,Nil,
Scr,600,46,600,46);
SRast:=SWin^.RPort;
CreateBoolXYData(600,35,Sxy[1],Sxy[2]);
SBor[1]:=Border(0,0,1,0,0,6,^Sxy[1],^SBor[2]);
SBor[2]:=Border(0,0,2,0,0,6,^Sxy[2],Nil);
DrawBorder(SRast,^SBor[1],5,2);
STxt[1]:=IntuiText(1,0,0,0,0,Nil,"Bist Du Dir da sicher ???",Nil);
PrintIText(SRast,^STxt[1],29,16);
CreateBoolXYData(150,22,Sxy[3],Sxy[4]);
SBor[3]:=Border(0,0,1,0,0,6,^Sxy[3],^SBor[4]);
SBor[4]:=Border(0,0,2,0,0,6,^Sxy[4],Nil);
STxt[2]:=IntuiText(1,0,0,67,7,Nil,"Ja",Nil);
STxt[3]:=IntuiText(1,0,0,63,7,Nil,"Nee",Nil);
for i:=1 to 2 do
SGad[i]:=Gadget(Nil,270+(i-1)*170,9,150,22,GADGHCOMP,RELVERIFY,
BOOLGADGET,^SBor[3],Nil,^STxt[i+1],0,Nil,i,0);
SGad[1].NextGadget:=^SGad[2];
SetAPen(SRast,1);
Move(SRast,336,25);
Draw(SRast,344,25);
Move(SRast,501,25);
Draw(SRast,509,25);
SWin^.FirstGadget:=^SGad[1];
RefreshGadgets(SWin^.FirstGadget,SWin,Nil);
repeat
ex:=false;
SMsg:=Wait_Port(SWin^.UserPort);
SMsg:=Get_Msg(SWin^.UserPort);
case SMsg^.Class of
GADGETUP : begin
ex:=true;
AGad:=SMsg^.IAddress;
case AGad^.GadgetID of
1 : Sure:=true;
2 : Sure:=false;
otherwise
end;
end;
RAWKEY : case SMsg^.Code of
$26,$43,$44 : begin
ex:=true;
Sure:=true;
end;
$36,$45 : begin
ex:=true;
Sure:=false;
end;
otherwise
end;
otherwise
end;
Reply_Msg(SMsg);
until ex;
Close_Window(SWin);
end;
{------------------------------------------------------------------------}
procedure StatusText(s:str);
begin
PrintIText(Rast,^Txt[21],120,203);
if s="" then
s:="Nix los hier...";
Txt[20]:=IntuiText(1,0,1,0,0,Nil,s,Nil);
PrintIText(Rast,^Txt[20],120,203);
end;
{------------------------------------------------------------------------}
procedure FlipDruck;
type DText = array[1..9] of str;
var DruckText : DText;
hs : string;
begin
DruckText:=DText("Paketzettel",
"Adresslabel klein",
"Adresslabel mittel",
"Adresslabel groß",
"Absenderlabel klein",
"Absenderlabel mittel",
"Absenderlabel groß",
"Postkarte",
"Postkarte doppelt");
if cnt<9 then
inc(cnt)
else
cnt:=1;
hs:="Druckform »"+DruckText[cnt]+"« angewählt";
StatusText(^hs);
Buf[14]:=DruckText[cnt];
Gad[18].NextGadget:=Nil;
RefreshGadgets(^Gad[18],Win,Nil);
Gad[18].NextGadget:=^Gad[19]
end;
{------------------------------------------------------------------------}
procedure FlipForm;
type FText = array[1..20] of str;
var FormText : FText;
begin
FormText:=FText("Warensendung",
"Büchersendung",
"Blindensendung",
"Eilsendung",
"Luftpost",
"Per Einschreiben",
"Eigenhändig",
"Nachnahme",
"Brief",
"Päckchen",
"Paket",
" ···",
"Cécogramme",
"Lettre",
"À remettre en main propre",
"Exprès",
"Recommandé",
"Par avion",
"Remboursement",
" ···");
if cnt2<20 then
inc(cnt2)
else
cnt2:=1;
Buf[15]:=FormText[cnt2];
Gad[19].NextGadget:=Nil;
RefreshGadgets(^Gad[19],Win,Nil);
Gad[19].NextGadget:=^Gad[20]
end;
{------------------------------------------------------------------------}
procedure SetColors;
begin
for i:=0 to 3 do
SetRGB4(^Vp,i,PDat.Colors[i,0],PDat.Colors[i,1],PDat.Colors[i,2]);
end;
{------------------------------------------------------------------------}
procedure Init;
begin
Scr:=Open_Screen(0,0,640,256,2,0,1,HIRES+GENLOCK_VIDEO,Nil);
if Scr=Nil then
Error("Konnte Screen nicht öffnen");
Vp:=Scr^.ViewPort;
PDat:=UpPr;
SetColors;
Win:=Open_Window(0,0,640,256,1,RAWKEY+GADGETUP,BORDERLESS+ACTIVATE+
RMBTRAP,Nil,Scr,640,256,640,256);
if Win=Nil then
Error("Konnte Window nicht öffnen");
Rast:=Win^.RPort;
PrcH:=FindTask(Nil);
Prc:=PrcH;
OWin:=Prc^.pr_WindowPtr;
Prc^.pr_WindowPtr:=Win;
CreateBoolXYData(620,240,xy[1],xy[2]);
Bor[1]:=Border(0,0,1,0,0,6,^xy[1],^Bor[2]);
Bor[2]:=Border(0,0,2,0,0,6,^xy[2],Nil);
DrawBorder(Rast,^Bor[1],10,5);
CreateBoolXYData(600,180,xy[3],xy[4]);
Bor[3]:=Border(0,0,1,0,0,6,^xy[3],^Bor[4]);
Bor[4]:=Border(0,0,2,0,0,6,^xy[4],Nil);
DrawBorder(Rast,^Bor[3],20,12);
CreateBoolXYData(508,10,xy[17],xy[18]);
Bor[19]:=Border(0,0,1,0,0,6,^xy[17],^Bor[20]);
Bor[20]:=Border(0,0,2,0,0,6,^xy[18],Nil);
DrawBorder(Rast,^Bor[19],112,201);
CreateBoolXYData(100,20,xy[5],xy[6]);
Bor[5]:=Border(0,0,1,0,0,6,^xy[5],^Bor[6]);
Bor[6]:=Border(0,0,2,0,0,6,^xy[6],Nil);
Bor[7]:=Bor[5];
Bor[8]:=Bor[6];
Bor[7].FrontPen:=2;
Bor[8].FrontPen:=1;
Bor[7].NextBorder:=^Bor[8];
Txt[0]:=IntuiText(1,0,0,22,6,Nil,"Drucken",Nil);
Txt[1]:=IntuiText(1,0,0,34,6,Nil,"Info",Nil);
Txt[2]:=IntuiText(1,0,0,38,6,Nil,"Neu",Nil);
Txt[3]:=IntuiText(1,0,0,30,6,Nil,"Prefs",Nil);
Txt[4]:=IntuiText(1,0,0,22,6,Nil,"Beenden",Nil);
for i:=0 to 4 do
Gad[i]:=Gadget(^Gad[i+1],21+i*125,220,100,20,GADGHCOMP,RELVERIFY,BOOLGADGET,
^Bor[5],^Bor[7],^Txt[i],0,Nil,i,0);
CreateBoolXYData(80,10,xy[7],xy[8]);
Bor[9]:=Border(0,0,1,0,0,6,^xy[7],^Bor[10]);
Bor[10]:=Border(0,0,2,0,0,6,^xy[8],Nil);
for i:=0 to 4 do begin
DrawBorder(Rast,^Bor[9],40,30+i*16);
DrawBorder(Rast,^Bor[9],341,110+i*16);
end;
DrawBorder(Rast,^Bor[9],20,201);
CreateStringXYData(156,8,xy[9],xy[10]);
CreateStringXYData(56,8,xy[17],xy[18]);
Bor[11]:=Border(0,0,1,0,0,6,^xy[9],^Bor[12]);
Bor[12]:=Border(0,0,2,0,0,6,^xy[10],Nil);
Bor[19]:=Border(0,0,1,0,0,6,^xy[17],^Bor[20]);
Bor[20]:=Border(0,0,2,0,0,6,^xy[18],Nil);
Txt[5]:=IntuiText(1,0,0,-80,0,Nil,"Name 1:",Nil);
Txt[6]:=IntuiText(1,0,0,-80,0,Nil,"Name 2:",Nil);
Txt[7]:=IntuiText(1,0,0,-80,0,Nil,"Straße:",Nil);
Txt[8]:=IntuiText(1,0,0,-80,0,Nil,"PLZ/Ort:",Nil);
Txt[9]:=IntuiText(1,0,0,-80,0,Nil,"Telefon:",Nil);
Txt[10]:=IntuiText(1,0,0,-80,0,Nil,"Ort:",Nil);
Txt[11]:=IntuiText(1,0,0,-80,0,Nil,"PLZ:",Nil);
for i:=1 to 15 do begin
Buf[i]:="";
UBuf[i]:="";
Inf[i]:=StringInfo(^Buf[i],^UBuf[i],0,31,0,0,0,0,0,0,Nil,0,Nil);
end;
Inf[5].MaxChars:=25;
Inf[10].MaxChars:=9;
Inf[15].MaxChars:=30;
for i:=11 to 13 do
Inf[i].MaxChars:=36;
for i:=5 to 9 do
Gad[i]:=Gadget(^Gad[i+1],132,32+(i-5)*16,160,10,GADGHCOMP,RELVERIFY,STRGADGET,
^Bor[11],Nil,^Txt[i],0,^Inf[i-4],i,0);
for i:=10 to 14 do
Gad[i]:=Gadget(^Gad[i+1],433,112+(i-10)*16,160,10,GADGHCOMP,RELVERIFY,STRGADGET,
^Bor[11],Nil,^Txt[i-5],0,^Inf[i-4],i,0);
Gad[13].GadgetText:=^Txt[10];
Gad[14].GadgetText:=^Txt[11];
Gad[14].Width:=60;
Gad[14].GadgetRender:=^Bor[19];
CreateStringXYData(246,8,xy[11],xy[12]);
Bor[13]:=Border(0,0,1,0,0,6,^xy[11],^Bor[14]);
Bor[14]:=Border(0,0,2,0,0,6,^xy[12],Nil);
for i:=15 to 17 do
Gad[i]:=Gadget(^Gad[i+1],42,128+(i-15)*16,240,10,GADGHCOMP,RELVERIFY,STRGADGET,
^Bor[13],Nil,Nil,0,^Inf[i-4],i,0);
CreateStringXYData(216,8,xy[13],xy[14]);
Bor[15]:=Border(0,0,1,0,0,6,^xy[13],^Bor[16]);
Bor[16]:=Border(0,0,2,0,0,6,^xy[14],Nil);
Txt[12]:=IntuiText(3,0,0,-26,-16,Nil,"Drucken als:",Nil);
Txt[13]:=IntuiText(3,0,0,-26,-16,Nil,"Besondere Versandform:",Nil);
for i:=18 to 19 do
Gad[i]:=Gadget(^Gad[i+1],373,48+(i-18)*32,220,10,GADGHCOMP,RELVERIFY,STRGADGET,
^Bor[15],Nil,^Txt[i-6],0,^Inf[i-4],i,0);
CreateBoolXYData(20,10,xy[15],xy[16]);
Bor[17]:=Border(0,0,1,0,0,6,^xy[15],^Bor[18]);
Bor[18]:=Border(0,0,2,0,0,6,^xy[16],Nil);
Dat[1]:=Ptr(Alloc_Mem(SizeOf(ImgPlane),2));
Dat[1]^:=ImgPlane(%0000111110000000,
%0011110111100000,
%0111000000110000,
%1110000000011000,
%1100000000011000,
%1100000011111111,
%1100000001111110,
%1100000000011000);
Img[1]:=Image(2,1,16,8,1,Dat[1],1,0,Nil);
for i:=20 to 21 do begin
Gad[i]:=Gadget(^Gad[i+1],341,46+(i-20)*32,20,10,GADGHNONE+GADGIMAGE,RELVERIFY,
BOOLGADGET,^Img[1],Nil,Nil,0,Nil,i,0);
DrawBorder(Rast,^Bor[17],341,46+(i-20)*32);
end;
CreateBoolXYData(30,11,xy[19],xy[20]);
Bor[21]:=Border(0,0,1,0,0,6,^xy[19],^Bor[22]);
Bor[22]:=Border(0,0,2,0,0,6,^xy[20],Nil);
Txt[22]:=IntuiText(1,0,0,3,2,Nil,"CLI",Nil);
Gad[22]:=Gadget(Nil,580,18,30,11,GADGHCOMP,RELVERIFY,
BOOLGADGET,^Bor[21],Nil,^Txt[22],0,Nil,22,0);
Txt[14]:=IntuiText(3,0,0,44,16,Nil,"Absender:",^Txt[15]);
Txt[15]:=IntuiText(3,0,0,44,112,Nil,"Kurze Info für Empfänger:",^Txt[16]);
Txt[16]:=IntuiText(1,0,0,45,176,Nil,"UniPrint V1.3 © by Dreamer 1993",^Txt[17]);
Txt[17]:=IntuiText(2,0,0,44,177,Nil,"UniPrint V1.3 © by Dreamer 1993",^Txt[18]);
Txt[18]:=IntuiText(3,0,0,345,96,Nil,"Empfänger:",^Txt[19]);
Txt[19]:=IntuiText(1,0,0,30,203,Nil,"Status:",Nil);
PrintIText(Rast,^Txt[14],0,0);
SetAPen(Rast,1);
Move(Rast,41,235);
Draw(Rast,49,235);
Move(Rast,179,235);
Draw(Rast,187,235);
Move(Rast,307,235);
Draw(Rast,315,235);
Move(Rast,424,235);
Draw(Rast,432,235);
Move(Rast,541,235);
Draw(Rast,549,235);
Move(Rast,583,28);
Draw(Rast,590,28);
SetAPen(Rast,3);
Move(Rast,410,40);
Draw(Rast,419,40);
Move(Rast,425,72);
Draw(Rast,434,72);
Move(Rast,43,120);
Draw(Rast,52,120);
Move(Rast,60,24);
Draw(Rast,67,24);
Move(Rast,344,104);
Draw(Rast,353,104);
cnt:=0;
FlipDruck;
cnt2:=19;
FlipForm;
FirstCall:=true;
Win^.FirstGadget:=^Gad[0];
RefreshGadgets(Win^.FirstGadget,Win,Nil);
Txt[21]:=IntuiText(1,0,1,0,0,Nil," ",Nil);
StatusText("Willkommen zu UniPrint V1.3 - © 1993 by Dreamer of Neoplasia");
end;
{------------------------------------------------------------------------}
procedure Neu;
begin
if UpPr.NewForm in [1,3,5,6,8] then begin
for i:=1 to 4 do begin
Buf[i]:="";
UBuf[i]:="";
end;
Gad[9].NextGadget:=Nil;
RefreshGadgets(^Gad[5],Win,Nil);
Gad[9].NextGadget:=^Gad[10];
end;
if UpPr.NewForm in [1,2,4,6,8] then begin
for i:=5 to 10 do begin
Buf[i]:="";
UBuf[i]:="";
end;
Gad[14].NextGadget:=Nil;
RefreshGadgets(^Gad[10],Win,Nil);
Gad[14].NextGadget:=^Gad[15];
end;
if UpPr.NewForm in [1,4,5,7,8] then begin
for i:=11 to 13 do begin
Buf[i]:="";
UBuf[i]:="";
end;
Gad[17].NextGadget:=Nil;
RefreshGadgets(^Gad[15],Win,Nil);
Gad[17].NextGadget:=^Gad[18];
end;
if UpPr.NewForm=1 then begin
cnt:=0;
FlipDruck;
cnt2:=19;
FlipForm;
end;
StatusText("");
end;
{------------------------------------------------------------------------}
procedure DefaultPrefs;
begin
PDat:=PrefsTyp("V1.3",
((10,10,10),(0,0,0),(13,14,13),(3,8,5)),
1,4,4);
UpPr:=PDat;
SetColors;
end;
{------------------------------------------------------------------------}
procedure Prefs;
var PWin : ^Window;
PRast: ^RastPort;
PMsg : ^IntuiMessage;
Pxy : array[1..20] of xyTyp;
PBor : array[1..20] of Border;
PImg : Image;
PGad : array[1..20] of Gadget;
PTxt : array[1..20] of IntuiText;
PCl : long;
PCod : word;
PAdr : ^Gadget;
PInfo: array[1..3] of PropInfo;
OldP : PrefsTyp;
ACol : cardinal;
AktProp : cardinal;
ex : boolean;
cnt1,cnt2,cnt3,cnt4,cnt5 : integer;
{······································································}
procedure OutText(x,y:integer;s:str);
var hs1,hs2 : IntuiText;
begin
hs1:=IntuiText(1,0,1,0,0,Nil," ",^hs2);
hs2:=IntuiText(1,0,1,0,0,Nil,s,Nil);
PrintIText(PRast,^hs1,x,y);
end;
{······································································}
procedure ShowOne(x:cardinal);
var h : string;
h2,h3: IntuiText;
begin
PInfo[x+1].HorizPot:=PDat.Colors[ACol,x]*4096;
PGad[x+9].NextGadget:=Nil;
RefreshGadgets(^PGad[x+9],PWin,Nil);
PGad[x+9].NextGadget:=^PGad[x+10];
h:=intstr(trunc(PInfo[x+1].HorizPot/4096));
h2:=IntuiText(1,0,1,250,120+x*16,Nil," ",^h3);
h3:=Intuitext(1,0,1,250,120+x*16,Nil,h,Nil);
PrintIText(PRast,^h2,0,0);
end;
{······································································}
procedure ShowColor(ACol:cardinal);
begin
SetAPen(PRast,ACol);
RectFill(PRast,165,91,272,106);
for i:=0 to 2 do
ShowOne(i);
end;
{······································································}
procedure ConvertColor(x:cardinal);
begin
PDat.Colors[ACol,x]:=trunc(PInfo[x+1].HorizPot/4096);
SetColors;
ShowOne(x);
end;
{······································································}
procedure IncColor(n:cardinal);
begin
if PDat.Colors[ACol,n]=15 then
PDat.Colors[ACol,n]:=0
else
inc(PDat.Colors[ACol,n]);
SetColors;
ShowOne(n);
end;
{······································································}
procedure FlipQual;
type QualText = array[1..3] of str;
var QText : QualText;
begin
QText:=QualText("Near Letter Quality",
"NLQ & Doublestrike",
"Draft Quality");
if cnt1=3 then
cnt1:=1
else
inc(cnt1);
PDat.Qual:=cnt1;
OutText(368,88,QText[cnt1]);
end;
{······································································}
procedure FlipRequest;
type RequestText = array[1..8] of str;
var RText : RequestText;
begin
RText:=RequestText("Ende",
"Ende & Neu",
"Ende & Druck",
"Ende & Neu & Druck",
"Neu",
"Neu & Druck",
"Druck",
"Keine Abfrage");
if cnt2=8 then
cnt2:=1
else
inc(cnt2);
PDat.Request:=cnt2;
OutText(368,120,RText[cnt2]);
end;
{······································································}
procedure FlipNew;
type NewText = array[1..8] of str;
var NText : NewText;
begin
NText:=NewText("Alles",
"Empfängeranschrift",
"Absenderanschrift",
"Empfänger & Info",
"Absender & Info",
"Empfänger & Absender",
"Info",
"Empfänger & Abs. & Info");
if cnt3=8 then
cnt3:=1
else
inc(cnt3);
PDat.NewForm:=cnt3;
OutText(368,152,NText[cnt3]);
end;
{······································································}
procedure FlipColor;
type ColorText = array[1..6] of str;
ColorTyp = array[1..6,0..3,0..2] of cardinal;
var CText : ColorText;
Color : ColorTyp;
j : cardinal;
begin
CText:=ColorText("Dreamer`s Special",
"Cool WB2.0 Style",
"Freaky WB1.3 Style",
"Shocking !!!",
"Wooden",
"Grau in grau");
Color:=ColorTyp(((10,10,10),(0,0,0),(13,14,13),(3,8,5)),
((10,10,10),(0,0,0),(14,14,14),(6,8,11)),
((0,5,10),(15,15,15),(0,0,2),(15,8,0)),
((15,0,0),(0,15,0),(0,0,15),(15,15,0)),
((10,7,0),(6,3,0),(15,12,0),(12,9,0)),
((10,10,10),(2,2,2),(13,13,13),(6,6,6)));
if cnt4=6 then
cnt4:=1
else
inc(cnt4);
if NotFirstCall then begin
for i:=0 to 3 do
for j:=0 to 2 do
PDat.Colors[i,j]:=Color[cnt4,i,j];
SetColors;
ShowColor(ACol);
end;
OutText(68,182,CText[cnt4]);
end;
{······································································}
procedure SavePrefs;
var f : file of PrefsTyp;
begin
Close_Window(PWin);
StatusText("Speichere Einstellungen ab...");
assign(f,"UniPrint.prf");
reset(f);
if ioresult>0 then begin
StatusText("Abspeichern klappte nicht, File nicht zu öffnen");
delay(2*50);
StatusText("");
exit;
end;
PDat.Version:="V1.3";
writeln(f,PDat);
if ioresult>0 then
StatusText("Schreibfehler, Einstellungen nicht gespeichert")
else
StatusText("Einstellungen gespeichert, alles OK...");
close(f);
delay(2*50);
StatusText("");
end;
{······································································}
procedure DefaultPrefs2;
begin
DefaultPrefs;
ACol:=0;
ShowColor(ACol);
cnt1:=PDat.Qual;
dec(cnt1);
FlipQual;
cnt2:=PDat.Request;
dec(cnt2);
FlipRequest;
cnt3:=PDat.NewForm;
dec(cnt3);
FlipNew;
ACol:=0;
cnt4:=0;
NotFirstCall:=false;
FlipColor;
cnt5:=0;
end;
{······································································}
begin
PDat:=UpPr;
OldP:=UpPr;
PWin:=Open_Window(15,6,610,237,1,GADGETUP+GADGETDOWN+RAWKEY+MOUSEMOVE,
BORDERLESS+ACTIVATE+RMBTRAP,Nil,Scr,610,237,610,237);
if PWin=Nil then begin
StatusText("Konnte Window nicht öffnen, Sorry Boss!!");
delay(2*50);
StatusText("");
exit;
end;
PRast:=PWin^.RPort;
CreateBoolXYData(300,20,Pxy[1],Pxy[2]);
PBor[1]:=Border(0,0,1,0,0,6,^Pxy[1],^PBor[2]);
PBor[2]:=Border(0,0,2,0,0,6,^Pxy[2],Nil);
DrawBorder(PRast,^PBor[1],160,11);
CreateBoolXYData(120,20,Pxy[3],Pxy[4]);
PBor[3]:=Border(0,0,1,0,0,6,^Pxy[3],^PBor[4]);
PBor[4]:=Border(0,0,2,0,0,6,^Pxy[4],Nil);
PTxt[1]:=IntuiText(1,0,0,32,6,Nil,"Default",Nil);
PTxt[2]:=IntuiText(1,0,0,36,6,Nil,"Nutzen",Nil);
PTxt[3]:=IntuiText(1,0,0,24,6,Nil,"Speichern",Nil);
PTxt[4]:=IntuiText(1,0,0,24,6,Nil,"Abbrechen",Nil);
for i:=1 to 4 do
PGad[i]:=Gadget(^PGad[i+1],20+(i-1)*150,210,120,20,GADGHCOMP,RELVERIFY,
BOOLGADGET,^PBor[3],Nil,^PTxt[i],0,Nil,i,0);
SetAPen(PRast,1);
Move(PRast,50,225);
Draw(PRast,58,225);
Move(PRast,204,225);
Draw(PRast,212,225);
Move(PRast,342,225);
Draw(PRast,350,225);
Move(PRast,492,225);
Draw(PRast,500,225);
CreateBoolXYData(270,150,Pxy[5],Pxy[6]);
PBor[5]:=Border(0,0,1,0,0,6,^Pxy[5],^PBor[6]);
PBor[6]:=Border(0,0,2,0,0,6,^Pxy[6],Nil);
DrawBorder(PRast,^PBor[5],20,45);
DrawBorder(PRast,^PBor[5],320,45);
CreateBoolXYData(120,36,Pxy[7],Pxy[8]);
PBor[7]:=Border(0,0,1,0,0,6,^Pxy[7],^PBor[8]);
PBor[8]:=Border(0,0,2,0,0,6,^Pxy[8],Nil);
PTxt[5]:=IntuiText(1,0,0,76,5,Nil,"Akt. Farbe:",Nil);
PGad[5]:=Gadget(^PGad[6],32,70,60,18,GADGHNONE,RELVERIFY,
BOOLGADGET,^PBor[7],Nil,Nil,0,Nil,5,0);
PGad[6]:=Gadget(^PGad[7],93,70,60,18,GADGHNONE,RELVERIFY,
BOOLGADGET,Nil,Nil,^PTxt[5],0,Nil,6,0);
PGad[7]:=Gadget(^PGad[8],32,89,60,18,GADGHNONE,RELVERIFY,
BOOLGADGET,Nil,Nil,Nil,0,Nil,7,0);
PGad[8]:=Gadget(^PGad[9],93,89,60,18,GADGHNONE,RELVERIFY,
BOOLGADGET,Nil,Nil,Nil,0,Nil,8,0);
Move(PRast,207,83);
Draw(PRast,215,83);
SetAPen(PRast,2);
RectFill(PRast,32,89,92,106);
SetAPen(PRast,3);
RectFill(PRast,93,89,152,106);
SetAPen(PRast,1);
RectFill(PRast,93,70,152,88);
CreateBoolXYData(107,15,Pxy[13],Pxy[14]);
PBor[13]:=Border(0,0,1,0,0,6,^Pxy[13],^PBor[14]);
PBor[14]:=Border(0,0,2,0,0,6,^Pxy[14],Nil);
DrawBorder(PRast,^PBor[13],165,91);
CreateBoolXYData(180,10,Pxy[9],Pxy[10]);
CreateBoolXYData(31,10,Pxy[11],Pxy[12]);
PBor[9]:=Border(0,0,1,0,0,6,^Pxy[9],^PBor[10]);
PBor[10]:=Border(0,0,2,0,0,6,^Pxy[10],Nil);
PBor[11]:=Border(0,0,1,0,0,6,^Pxy[11],^PBor[12]);
PBor[12]:=Border(0,0,2,0,0,6,^Pxy[12],Nil);
for i:=6 to 8 do
PTxt[i]:=IntuiText(1,0,0,-16,1,Nil,"R",Nil);
PTxt[7].IText:="G";
PTxt[8].IText:="B";
PImg:=Image(0,0,0,0,0,Nil,0,0,Nil);
for i:=9 to 11 do begin
PInfo[i-8]:=PropInfo(AUTOKNOB+FREEHORIZ+PROPBORDERLESS,
PDat.Colors[0,i-9]*4096,0,
round(MAXBODY/16),MAXBODY,0,0,0,0,0,0);
PGad[i]:=Gadget(^PGad[i+1],52,118+(i-9)*16,180,10,GADGHNONE,
FOLLOWMOUSE+RELVERIFY+GADGIMMEDIATE,PROPGADGET,
^PImg,Nil,^PTxt[i-3],0,^PInfo[i-8],i,0);
DrawBorder(PRast,^PBor[9],52,118+(i-9)*16);
DrawBorder(PRast,^PBor[11],241,118+(i-9)*16);
end;
for i:=0 to 2 do begin
Move(PRast,35,127+i*16);
Draw(PRast,43,127+i*16);
end;
CreateBoolXYData(210,10,Pxy[13],Pxy[14]);
PBor[13]:=Border(0,0,1,0,0,6,^Pxy[13],^PBor[14]);
PBor[14]:=Border(0,0,2,0,0,6,^Pxy[14],Nil);
DrawBorder(PRast,^PBor[13],62,180);
for i:=0 to 1 do
DrawBorder(PRast,^Bor[17],32,180);
PTxt[9]:=IntuiText(1,0,0,5,-14,Nil,"Voreingestellte Farben:",Nil);
PGad[12]:=Gadget(^PGad[14],32,180,20,10,GADGHNONE+GADGIMAGE,RELVERIFY,
BOOLGADGET,^Img[1],Nil,^PTxt[9],0,Nil,12,0);
Move(PRast,35,174);
Draw(PRast,43,174);
{ CreateBoolXYData(210,10,Pxy[15],Pxy[16]);
PBor[15]:=Border(0,0,1,0,0,6,^Pxy[15],^PBor[16]);
PBor[16]:=Border(0,0,2,0,0,6,^Pxy[16],Nil); }
for i:=10 to 12 do
PTxt[i]:=IntuiText(1,0,0,5,-14,Nil,"Druckqualität:",Nil);
PTxt[11].IText:="Ja/Nein Abfrage bei:";
PTxt[12].IText:="Neu löscht:";
for i:=14 to 16 do begin
PGad[i]:=Gadget(^PGad[i+1],332,86+(i-14)*32,20,10,GADGHNONE+GADGIMAGE,
RELVERIFY,BOOLGADGET,^Img[1],Nil,^PTxt[i-4],0,Nil,i,0);
DrawBorder(PRast,^Bor[17],332,86+(i-14)*32);
DrawBorder(PRast,^PBor[13],362,86+(i-14)*32);
end;
PGad[16].NextGadget:=Nil;
Move(PRast,376,81);
Draw(PRast,384,81);
Move(PRast,336,112);
Draw(PRast,343,112);
Move(PRast,368,144);
Draw(PRast,375,144);
PTxt[13]:=IntuiText(1,0,0,211,17,Nil,"UniPrint V1.3 Preferences",^PTxt[14]);
PTxt[14]:=IntuiText(2,0,0,210,18,Nil,"UniPrint V1.3 Preferences",^PTxt[15]);
PTxt[15]:=IntuiText(1,0,0,68,53,Nil,"- Farbeinstellungen -",^PTxt[16]);
PTxt[16]:=IntuiText(2,0,0,67,54,Nil,"- Farbeinstellungen -",^PTxt[17]);
PTxt[17]:=IntuiText(1,0,0,356,53,Nil,"- Programmeinstellungen -",^PTxt[18]);
PTxt[18]:=IntuiText(2,0,0,355,54,Nil,"- Programmeinstellungen -",Nil);
PrintIText(PRast,^PTxt[13],0,0);
PWin^.FirstGadget:=^PGad[1];
RefreshGadgets(PWin^.FirstGadget,PWin,Nil);
cnt1:=PDat.Qual;
dec(cnt1);
FlipQual;
cnt2:=PDat.Request;
dec(cnt2);
FlipRequest;
cnt3:=PDat.NewForm;
dec(cnt3);
FlipNew;
ACol:=0;
cnt4:=0;
NotFirstCall:=false;
FlipColor;
cnt5:=0;
ShowColor(ACol);
repeat
ex:=false;
PMsg:=Wait_Port(PWin^.UserPort);
PMsg:=Get_Msg(PWin^.UserPort);
PCl:=PMsg^.Class;
PCod:=PMsg^.Code;
PAdr:=PMsg^.IAddress;
Reply_Msg(PMsg);
case PCl of
GADGETUP : case PAdr^.GadgetID of
1 : DefaultPrefs2;
2 : begin
UpPr:=PDat;
ex:=true;
end;
3 : begin
SavePrefs;
exit;
end;
4 : begin
ex:=true;
UpPr:=OldP;
PDat:=OldP;
SetColors;
end;
5..8 : begin
ACol:=PAdr^.GadgetID-5;
ShowColor(ACol);
end;
9..11: ConvertColor(PAdr^.GadgetID-9);
12 : begin
NotFirstCall:=true;
FlipColor;
end;
14 : FlipQual;
15 : FlipRequest;
16 : FlipNew;
otherwise
end;
GADGETDOWN : if PAdr^.GadgetID in [9..11] then
AktProp:=PAdr^.GadgetID-9;
MOUSEMOVE : ConvertColor(AktProp);
RAWKEY : case PCod of
$22 : DefaultPrefs2;
$36 : begin
UpPr:=PDat;
ex:=true;
end;
$21 : begin
SavePrefs;
exit;
end;
$20,$45 : begin
ex:=true;
UpPr:=OldP;
PDat:=OldP;
SetColors;
end;
$01..$04 : begin
ACol:=PCod-1;
ShowColor(ACol);
end;
$1d..$1f : begin
ACol:=PCod-$1d;
ShowColor(ACol);
end;
$2d : begin
ACol:=3;
ShowColor(ACol);
end;
$23 : begin
if cnt5=3 then
cnt5:=0
else
inc(cnt5);
ACol:=cnt5;
ShowColor(ACol);
end;
$34 : begin
NotFirstCall:=true;
FlipColor;
end;
$10 : FlipQual;
$26 : FlipRequest;
$28 : FlipNew;
$13 : IncColor(0);
$24 : IncColor(1);
$35 : IncColor(2);
otherwise
end;
otherwise
end;
until ex;
Close_Window(PWin);
end;
{------------------------------------------------------------------------}
procedure ShowInfo;
var IWin : ^Window;
IRast: ^RastPort;
IMsg : ^IntuiMessage;
Ixy : array[1..4] of xyTyp;
IBor : array[1..4] of Border;
IGad : array[1..2] of Gadget;
ITxt : array[1..15] of IntuiText;
ex : boolean;
begin
IWin:=Open_Window(20,12,600,180,1,GADGETUP+RAWKEY,BORDERLESS+ACTIVATE+
RMBTRAP,Nil,Scr,600,180,600,180);
if IWin=Nil then begin
StatusText("Zu wenig Speicher - Window nicht zu öffnen");
delay(2*50);
StatusText("");
exit;
end;
StatusText("Check it out, Freak !!!");
IRast:=IWin^.RPort;
CreateBoolXYData(300,20,Ixy[1],Ixy[2]);
IBor[1]:=Border(0,0,1,0,0,6,^Ixy[1],^IBor[2]);
IBor[2]:=Border(0,0,2,0,0,6,^Ixy[2],Nil);
DrawBorder(IRast,^IBor[1],160,16);
ITxt[1]:=IntuiText(1,0,0,211,22,Nil,"UniPrint V1.3 Infofenster",^ITxt[2]);
ITxt[2]:=IntuiText(2,0,0,210,23,Nil,"UniPrint V1.3 Infofenster",^ITxt[3]);
ITxt[3]:=IntuiText(3,0,0,218,44,Nil,"© 8/1993 by Jan Stötzer",^ITxt[4]);
ITxt[4]:=IntuiText(1,0,0,158,60,Nil,"Dieses Programm ist FREEWARE, solange:",^ITxt[5]);
ITxt[5]:=IntuiText(1,0,0,166,68,Nil,"· damit kein Geld verdient wird und",^ITxt[6]);
ITxt[6]:=IntuiText(1,0,0,166,76,Nil,"· nichts an Prog & Dok verändert wird.",^ITxt[14]);
ITxt[14]:=IntuiText(1,0,0,166,84,Nil,"· nähere Infos in der Anleitung",^ITxt[7]);
ITxt[7]:=IntuiText(1,0,0,138,100,Nil,"Für Bugreports, Hinweise u.a. schreibt an:",^ITxt[8]);
ITxt[8]:=IntuiText(2,0,0,142,116,Nil,"Jan Stötzer, An der Hasel 195, 98527 Suhl",^ITxt[9]);
ITxt[9]:=IntuiText(3,0,0,86,132,Nil,"Greetings fly to: PackMAN, Diesel, Sir Jinx, Doc Brown,",^ITxt[10]);
ITxt[10]:=IntuiText(3,0,0,94,140,Nil,"Bitworm, Amiga500SL, Buster, Erik, Ricki, Andi... !!",^ITxt[11]);
ITxt[11]:=IntuiText(1,0,0,41,159,Nil,"Have fun with it --> Dreamer/NPS",^ITxt[12]);
ITxt[12]:=IntuiText(2,0,0,40,160,Nil,"Have fun with it --> Dreamer/NPS",Nil);
PrintIText(IRast,^ITxt[1],0,0);
CreateBoolXYData(80,16,Ixy[3],Ixy[4]);
IBor[3]:=Border(0,0,1,0,0,6,^Ixy[3],^IBor[4]);
IBor[4]:=Border(0,0,2,0,0,6,^Ixy[4],Nil);
ITxt[13]:=IntuiText(1,0,0,32,4,Nil,"OK",Nil);
ITxt[15]:=IntuiText(1,0,0,20,4,Nil,"Prefs",Nil);
IGad[1]:=Gadget(^IGad[2],341,156,80,16,GADGHCOMP,RELVERIFY,BOOLGADGET,
^IBor[3],Nil,^ITxt[13],0,Nil,1,0);
IGad[2]:=Gadget(Nil,441,156,80,16,GADGHCOMP,RELVERIFY,BOOLGADGET,
^IBor[3],Nil,^ITxt[15],0,Nil,2,0);
IWin^.FirstGadget:=^IGad;
RefreshGadgets(IWin^.FirstGadget,IWin,Nil);
SetAPen(IRast,1);
Move(IRast,371,169);
Draw(IRast,379,169);
Move(IRast,459,169);
Draw(IRast,467,169);
ex:=false;
repeat
IMsg:=Wait_Port(IWin^.Userport);
IMsg:=Get_Msg(IWin^.UserPort);
case IMsg^.Class of
GADGETUP : begin
MAdr:=IMsg^.IAddress;
case MAdr^.GadgetID of
1 : ex:=true;
2 : Prefs;
otherwise
end;
end;
RAWKEY : case IMsg^.Code of
$18,$45 : ex:=true;
$19 : Prefs;
otherwise
end;
otherwise
end;
Reply_Msg(IMsg);
until ex=true;
Close_Window(IWin);
StatusText("");
end;
{------------------------------------------------------------------------}
procedure PrintIt;
type Ziffer = array[1..7] of str;
var p : text;
z : array[0..9] of Ziffer;
err : integer;
plz : array[1..5] of integer;
az : integer;
j : integer;
{······································································}
function Fill(what:str,num:integer):string;
var i,l : integer;
s : string;
begin
l:=length(what);
s:=copy(what,1,num);
if l<num then
for i:=1 to num-l do
s:=(s+" ");
Fill:=s;
end;
{······································································}
procedure Absender_Klein;
begin
write(p,chr(27),"[0z",chr(27),"[4w");
writeln(p,"Abs.: ",Buf[1]);
writeln(p," ",Buf[3]);
writeln(p," ",Buf[4]);
end;
{······································································}
procedure Absender_Mittel;
begin
write(p,chr(27),"[0z",chr(27),"[4w");
writeln(p,"Abs.: ",Buf[1]);
for i:=2 to 4 do
writeln(p," ",Buf[i]);
writeln(p," Tel.: ",Buf[5]);
end;
{······································································}
procedure Absender_Gross;
begin
write(p,chr(27),"[0z",chr(27),"[2w");
writeln(p,"Abs.: ",Buf[1]);
for i:=2 to 4 do
writeln(p," ",Buf[i]);
writeln(p," Tel.: ",Buf[5]);
end;
{······································································}
procedure Adresse_Klein;
begin
write(p,chr(27),"[0z",chr(27),"[2w");
for i:=6 to 8 do
writeln(p," ",Buf[i]);
writeln(p,copy(Buf[10],1,5)," ",Buf[9]);
end;
{······································································}
procedure Adresse_Mittel;
begin
write(p,chr(27),"[1z",chr(27),"[0w");
for i:=6 to 8 do
writeln(p," ",Buf[i]);
writeln(p,copy(Buf[10],1,5)," ",Buf[9]);
end;
{······································································}
procedure Adresse_Gross;
begin
write(p,chr(27),"[1z",chr(27),"[0w");
for i:=6 to 8 do
writeln(p," ",Buf[i]);
writeln(p);
write(p,chr(27),"[6w",copy(Buf[10],1,5)," ");
writeln(p,chr(27),"[0w"," ",Buf[9]);
end;
{······································································}
procedure Postkarte;
begin
write(p,chr(27),"[0z",chr(27),"[2w",chr(27),"[4m");
writeln(p," ");
write(p,chr(27),"[0m","| | ");
writeln(p,chr(27),"[4m"," ",chr(27),"[0m"," |");
write(p,"| ",chr(27),"[4w","Abs.:",Fill(Buf[1],30));
writeln(p," |",chr(27),"[3w",chr(27),"[2w"," Postkarte | | |");
for i:=2 to 4 do begin
write(p,"| ",chr(27),"[4w"," ",Fill(Buf[i],30));
writeln(p," |",chr(27),"[3w",chr(27),"[2w"," | | |");
end;
write(p,"| ",chr(27),"[4w"," Tel.: ",Fill(Buf[5],24));
writeln(p," |",chr(27),"[3w",chr(27),"[2w"," | | |");
write(p,"| ",chr(27),"[4w"," |");
write(p,chr(27),"[3w",chr(27),"[2w"," ",chr(27),"[4m","| |");
writeln(p,chr(27),"[0m"," |");
for i:=1 to 10 do begin
write(p,"| ",chr(27),"[4w"," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
end;
for i:=6 to 8 do begin
write(p,"| ",chr(27),"[4w"," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," ",chr(27),"[4m",Fill(Buf[i],27),chr(27),"[0m"," |");
write(p,"| ",chr(27),"[4w"," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
end;
for i:=1 to 5 do begin
write(p,"| ",chr(27),"[4w");
for j:=1 to 5 do begin
az:=plz[j];
write(p,z[az,i]," ");
end;
writeln(p," |",chr(27),"[3w",chr(27),"[2w"," |");
end;
write(p,"| ",chr(27),"[4w");
for j:=1 to 5 do begin
az:=plz[j];
write(p,z[az,6]," ");
end;
writeln(p," |",chr(27),"[3w",chr(27),"[2w"," ",chr(27),"[4m",Fill(Buf[9],27),chr(27),"[0m"," |");
write(p,"| ",chr(27),"[4w");
for j:=1 to 5 do begin
az:=plz[j];
write(p,z[az,7]," ");
end;
writeln(p," |",chr(27),"[3w",chr(27),"[2w"," |");
write(p,"| ",chr(27),"[4w"," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |",chr(27),"[4m");
write(p,"| ",chr(27),"[4w"," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |",chr(27),"[0m");
end;
{······································································}
procedure Paketzettel;
begin
write(p,chr(27),"[2w",chr(27),"[0z",chr(27),"[4m");
writeln(p," ");
writeln(p,chr(27),"[0m","| | |");
write(p,"| ",chr(27),"[4w","Abs.:",Fill(Buf[1],30)," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
for i:=2 to 4 do begin
write(p,"| ",chr(27),"[4w"," ",Fill(Buf[i],30)," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
end;
write(p,"| ",chr(27),"[4w"," Tel.: ",Fill(Buf[5],24)," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
for i:=1 to 3 do begin
write(p,"| ",chr(27),"[4w"," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
end;
write(p,chr(27),"[4m","| ",chr(27),"[4w"," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |",chr(27),"[0m");
write(p,"| ",chr(27),"[4w",chr(27),"[4v","Kurze Mitteilungen an Empfänger: |");
write(p," Besondere Versandformen/Vorausverfügungen:");
writeln(p,chr(27),"[0v",chr(27),"[0w","|",chr(27),"[3w",chr(27),"[2w");
write(p,"| ",chr(27),"[4w"," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
write(p,"| ",chr(27),"[4w",Fill(Buf[11],35)," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," ",Fill(Buf[15],29)," |");
for i:=12 to 13 do begin
write(p,"| ",chr(27),"[4w",Fill(Buf[i],35)," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
end;
write(p,chr(27),"[4m","| ",chr(27),"[4w"," |");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |",chr(27),"[0m");
write(p,"| ",chr(27),"[4w"," ");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
for i:=6 to 8 do begin
write(p,"| ",chr(27),"[4w"," ");
writeln(p,chr(27),"[3w",chr(27),"[2w"," ",chr(27),"[4m",Fill(Buf[i],27),chr(27),"[0m"," |");
write(p,"| ",chr(27),"[4w"," ");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |");
end;
for i:=1 to 5 do begin
write(p,"| ",chr(27),"[4w");
for j:=1 to 5 do begin
az:=plz[j];
write(p,z[az,i]," ");
end;
writeln(p," ",chr(27),"[3w",chr(27),"[2w"," |");
end;
write(p,"| ",chr(27),"[4w");
for j:=1 to 5 do begin
az:=plz[j];
write(p,z[az,6]," ");
end;
writeln(p," ",chr(27),"[3w",chr(27),"[2w"," ",chr(27),"[4m",Fill(Buf[9],27),chr(27),"[0m"," |");
write(p,"| ",chr(27),"[4w");
for j:=1 to 5 do begin
az:=plz[j];
write(p,z[az,7]," ");
end;
writeln(p," ",chr(27),"[3w",chr(27),"[2w"," |");
write(p,"| ",chr(27),"[4w"," ");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |",chr(27),"[4m");
write(p,"| ",chr(27),"[4w"," ");
writeln(p,chr(27),"[3w",chr(27),"[2w"," |",chr(27),"[0m");
end;
{······································································}
procedure Postkarte_Doppelt;
begin
Postkarte;
for i:=1 to 31 do begin
write(p,"| ",chr(27),"[4w"," ");
writeln(p,chr(27),"[2w"," |");
end;
write(p,chr(27),"[4m","| ",chr(27),"[4w");
write(p," ",chr(27),"[2w");
writeln(p," |",chr(27),"[0m");
end;
{······································································}
begin
z[0]:=Ziffer(" *** ",
" * *",
" * *",
" * *",
" * *",
" * *",
" *** ");
z[1]:=Ziffer(" * ",
" ** ",
" * * ",
" * ",
" * ",
" * ",
" *** ");
z[2]:=Ziffer(" *** ",
" * *",
" *",
" * ",
" * ",
" * ",
" *****");
z[3]:=Ziffer(" *** ",
" * *",
" *",
" ** ",
" *",
" * *",
" *** ");
z[4]:=Ziffer(" ** ",
" * * ",
" * * ",
" *****",
" * ",
" * ",
" * ");
z[5]:=Ziffer(" *****",
" * ",
" * ",
" **** ",
" *",
" * *",
" *** ");
z[6]:=Ziffer(" *** ",
" * *",
" * ",
" **** ",
" * *",
" * *",
" *** ");
z[7]:=Ziffer(" *****",
" *",
" *",
" * ",
" * ",
" * ",
" * ");
z[8]:=Ziffer(" *** ",
" * *",
" * *",
" *** ",
" * *",
" * *",
" *** ");
z[9]:=Ziffer(" *** ",
" * *",
" * *",
" ****",
" *",
" *",
" *** ");
for i:=1 to 5 do
val(copy(Buf[10],i,1),plz[i],err);
assign(p,"prt:");
rewrite(p);
if ioresult>0 then begin
StatusText("Drucker nicht ansprechbar, keine Ausgabe möglich...");
delay(2*50);
StatusText("");
exit;
end;
StatusText("Druckvorgang läuft ...");
if FirstCall then begin
write(p,chr(27),"c");
writeln(p,chr(27),"[2",chr(34),"z"," ");
writeln(p);
close(p);
assign(p,"prt:");
rewrite(p);
FirstCall:=false
end;
write(p,chr(27),"#1");
if UpPr.Qual=3 then
write(p,chr(27),"[1",chr(34),"z")
else begin
write(p,chr(27),"[2",chr(34),"z");
if UpPr.Qual=2 then
write(p,chr(27),"[4",chr(34),"z");
end;
case cnt of
1 : Paketzettel;
2 : Adresse_Klein;
3 : Adresse_Mittel;
4 : Adresse_Gross;
5 : Absender_Klein;
6 : Absender_Mittel;
7 : Absender_Gross;
8 : Postkarte;
9 : Postkarte_Doppelt;
otherwise
end;
StatusText("Drucken beendet");
Delay(2*50);
StatusText("");
close(p);
end;
{------------------------------------------------------------------------}
procedure Cli;
var CWin : ^Window;
CMsg : ^IntuiMessage;
ex : boolean;
begin
CWin:=Open_Window(340,0,300,10,1,MOUSEBUTTONS,WINDOWDRAG+WINDOWDEPTH+ACTIVATE+
RMBTRAP,"Zurück zu UniPrint !!!",Nil,300,12,300,12);
if CWin=Nil then
exit;
ScreenToBack(Scr);
repeat
ex:=false;
CMsg:=Wait_Port(CWin^.UserPort);
CMsg:=Get_Msg(CWin^.UserPort);
case CMsg^.Class of
MOUSEBUTTONS : if (CMsg^.Code and $80)=0 then
if (CMsg^.Code and 1)=1 then
ex:=true;
otherwise
end;
Reply_Msg(CMsg);
until ex;
Close_Window(CWin);
ScreenToFront(Scr);
end;
{------------------------------------------------------------------------}
procedure LoadPrefs;
begin
writeln("Lade UniPrint-Einstellungen");
writeln;
assign(f,"UniPrint.prf");
reset(f);
if ioresult=0 then
readln(f,UpPr);
if ioresult>0 then begin
writeln("Einstellungen konnten nicht geladen werden.");
writeln("Benutze Standarteinstellungen");
writeln;
write(" ---> RETURN");
readln(x);
DefaultPrefs;
end else begin
writeln("Einstellungen erfolgreich geladen");
if UpPr.Version<>"V1.3" then begin
writeln;
writeln("Das sind keine UniPrintV1.3-Einstellungen !!!");
writeln("Benutze Standarteinstellungen...");
writeln;
write(" ---> RETURN");
readln(x);
DefaultPrefs;
end;
end;
end;
{------------------------------------------------------------------------}
begin
OpenLib(IntBase,"intuition.library",0);
if IntBase=Nil then
Error("Sorry, no Intuition...");
OpenLib(GfxBase,"graphics.library",0);
if GfxBase=Nil then
Error("Sorry, no Graphics...");
if fromWB then begin
WWin:=Open_Window(100,100,200,60,1,0,ACTIVATE,"UniPrint V1.3",Nil,
200,60,200,60);
if WWin<>Nil then begin
WCon:=OpenConsole(WWin);
if WCon<>Nil then begin
SetStdIO(WCon);
LoadPrefs;
SetStdIO(Nil);
CloseConsole(WCon);
Close_Window(WWin);
end;
end;
end else
LoadPrefs;
Init;
ex:=false;
repeat
Msg:=Wait_Port(Win^.UserPort);
Msg:=Get_Msg(Win^.UserPort);
MCl:=Msg^.Class;
MAdr:=Msg^.IAddress;
MCod:=Msg^.Code;
Reply_Msg(Msg);
case MCl of
GADGETUP : case MAdr^.GadgetID of
0 : if UpPr.Request in [3,4,6,7] then begin
if Sure then
PrintIt;
end else PrintIt;
1 : ShowInfo;
2 : if ((UpPr.Request>3) and (UpPr.Request<7))
or (UpPr.Request=2) then begin
if Sure then Neu;
end else
Neu;
3 : Prefs;
4 : if UpPr.Request<5 then begin
if Sure then
ex:=true;
end else
ex:=true;
5..16 : ok:=ActivateGadget(^Gad[MAdr^.GadgetID+1],Win,Nil);
17 : ok:=ActivateGadget(^Gad[5],Win,Nil);
20 : FlipDruck;
21 : FlipForm;
22 : Cli;
otherwise
end;
RAWKEY : case MCod of
$22 : if UpPr.Request in [3,4,6,7] then begin
if Sure then
PrintIt;
end else PrintIt;
$35,$45 : if UpPr.Request<5 then begin
if Sure then
ex:=true;
end else
ex:=true;
$36 : if ((UpPr.Request>3) and (UpPr.Request<7))
or (UpPr.Request=2) then begin
if Sure then Neu;
end else
Neu;
$17 : ShowInfo;
$19 : Prefs;
$20 : FlipDruck;
$34 : FlipForm;
$21 : ok:=ActivateGadget(^Gad[5],Win,Nil);
$12 : ok:=ActivateGadget(^Gad[10],Win,Nil);
$27 : ok:=ActivateGadget(^Gad[15],Win,Nil);
$33 : Cli;
otherwise
end;
otherwise
end;
until ex=true;
Prc^.pr_WindowPtr:=OWin;
Free_Mem(Long(Dat[1]),SizeOf(ImgPlane));
Close_Window(Win);
Close_Screen(Scr);
CloseLib(GfxBase);
CloseLib(IntBase);
end.